package com.yumeko.controller;

import com.yumeko.service.ResumeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @program: First_Generation_Cloud
 * @description:
 * @author: Zheng Hao
 * @create: 2020-04-20 15:12
 */
@RestController
@RequestMapping("/resume")
public class ResumeController {
    @Autowired
    private ResumeService resumeService;

    @Value("${server.port}")
    private String serverport;

    //"/resume/openstate/1545132"
    @GetMapping("/openstate/{userId}")
    public Integer findDefaultResumeState(@PathVariable Long userId) {
        return resumeService.findDefaultResumeByUserId(userId).getIsOpenResume() + Integer.valueOf(serverport);
    }

    @GetMapping("/openstate1/{userId}")
    public String findDefaultResumeState1(@PathVariable Long userId) {
        return serverport;
    }
}
